#include "ConversionClickToRotation.h"

ConversionClickToRotation::ConversionClickToRotation(int sens, Transform* T)
{
	this->sens = sens;
	this->transform = T;
}

void ConversionClickToRotation::update()
{
	bool estEnfonce = static_cast < SFBool *>(event.ptr)->getValue();
	if(estEnfonce)
	{
		if((this->transform->rotation->getValue().angle/this->sens<=0)||((value.angle>-0.7)&&(value.angle<0))||((value.angle<0.7)&&(value.angle>0)))
			value.angle= this->transform->rotation->getValue().angle+(sens*PAS);
	}
}